<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>超市账单管理系统-用户管理</title>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
</head>
<body>

	<div class="menu">

		<table>
			<tbody>
				<tr>
					<td><form method="post" action="${pageContext.request.contextPath}/UserServlet?type=searchByName">
							<input name="method" value="query" class="input-text"
								type="hidden"> 用户名：<input name="name"
								class="input-text" type="text" >&nbsp;&nbsp;&nbsp;&nbsp;
							<input value="查 询" type="submit">
						</form>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="main">

		<div class="optitle clearfix">
			<em><input value="添加用户" class="input-button"
				onclick="window.location='${pageContext.request.contextPath}/UserServlet?type=goAdd'" type="button">
			</em>
			<div class="title">用户管理&gt;&gt;</div>
		</div>
		<div class="content">
			<table class="list">
				<tbody>
					<tr>
						<td width="70" height="29"><div class="STYLE1" align="center">编号</div>
						</td>
						<td width="80"><div class="STYLE1" align="center">用户名</div>
						</td>
						<td width="80"><div class="STYLE1" align="center">用户账号</div>
						</td>
						<td width="100"><div class="STYLE1" align="center">性别</div>
						</td>
						<td width="100"><div class="STYLE1" align="center">出生日期</div>
						</td>
						<td width="150"><div class="STYLE1" align="center">电话</div>
						</td>
						<td width="150"><div class="STYLE1" align="center">权限</div>
						</td>
					</tr>
					<c:forEach var="user" items="${allUsers}">
					<tr>
						<td height="23"><span class="STYLE1">${user.userId}</span>
						</td>
						<td><span class="STYLE1"> ${user.name} </span>
						</td>
						<td><span class="STYLE1"><a href="${pageContext.request.contextPath}/UserServlet?type=goUpdate&userId=${user.userId}"> ${user.loginname}</a>
						</span>
						</td>

						<td><span class="STYLE1">
						<c:choose>
							<c:when test="${user.gender==1}">男</c:when>
							<c:otherwise> 女</c:otherwise>
						</c:choose>
						 </span>
						</td>
						<td><span class="STYLE1"> ${user.birthdate}</span>
						</td>
						<td><span class="STYLE1">${user.phone}</span>
						</td>
						<td><span class="STYLE1">
						
						<c:choose>
							<c:when test="${user.userType==1}">管理员</c:when>
							<c:when test="${user.userType==2}">普通员工</c:when>
							<c:otherwise> 经理</c:otherwise>
						</c:choose>
					     </span>
						</td>
					</tr>
					
					</c:forEach>
					
				</tbody>
			</table>
		</div>
	</div>
</body>
</html>